function formatDate(cellvalue){
	return formartDate("yyyy-MM-dd",cellvalue.time);
}

$(function (){
	$("div[class='table-responsive'] table thead").find("input[type='checkbox']").click(function (){
		var _t = $(this);
		var table = _t.closest("table");
		if(_t.is(':checked')){
			table.find("tbody input[type='checkbox']").attr("checked",true);
		}else{
			table.find("tbody input[type='checkbox']").attr("checked",false);
		}
	});
	$("div[class='table-responsive'] table tbody").find("input[type='checkbox']").click(function (){
		checkedHead(this);
	});
});

function checkedHead(obj){
	var _t = $(obj);
	var tbody = _t.closest("tbody");
	if(_t.is(':checked')){
		if(tbody.find("input[type='checkbox']").not("input:checked").length == 0){
			tbody.parent("table").find("thead input[type='checkbox']").attr("checked",true);
		}
	}else{
		tbody.parent("table").find("thead input[type='checkbox']").attr("checked",false);
	}
}